import request from '@/router/axios';

export const getList = (page, size, params) => {
  return request({
    url: '/order/sellerOrderDistribution/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}
export const getDetail = (distributionId) => {
  return request({
    url: '/order/sellerOrderDistribution/detail',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      distributionId,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/order/orderDistribution/add',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/order/orderDistribution/edit',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const changeStatus = (userId, status) => {
  return request({
    url: '/order/orderDistribution/changeStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}
export const sendGoods = (row) => {
  return request({
    url: '/order/sellerOrderDistribution/sendGoods',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}
export const modifyLogistics = (row) => {
  return request({
    url: 'order/sellerOrderDistribution/modifyLogistics',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}
export const getOrderFormGoods = (data) => {
  return request({
    url: 'order/sellerOrderFormGoods/list',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: data
  })
}
export const isGoodsChoiceType = (goodsIds) => {
  return request({
    url: 'base/sellerGoods/isGoodsChoiceType',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {goodsIds}
  })
}